package com.app.web.base.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * Project: web<br>
 * Description: 角色实体表<br>
 * Copyright (c) 2012<br>
 * All Rights Reserved.<br>
 * @author <a href="mailto:gly420@163.com">GuanLuYong</a><br>
 */
@Entity
@Table(name = "WEB_ROLE")
public class Role extends BaseModel implements Serializable {
	private static final long serialVersionUID = 1L;
	/**
	 * 角色编码
	 */
	@Column(name = "CODE", length = 30)
	private String code;
	/**
	 * 角色名称
	 */
	@Column(name = "NAME", length = 200)
	private String name;
	/**
	 * 角色用户关联
	 */
	@OneToMany(mappedBy = "role")
	private List<UserRole> userRoles;
	/**
	 * 角色资源关联
	 */
	@OneToMany(mappedBy = "role")
	private List<RoleResource> roleResources;
	
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<UserRole> getUserRoles() {
		return userRoles;
	}

	public void setUserRoles(List<UserRole> userRoles) {
		this.userRoles = userRoles;
	}

	public List<RoleResource> getRoleResources() {
		return roleResources;
	}

	public void setRoleResources(List<RoleResource> roleResources) {
		this.roleResources = roleResources;
	}
	
}
